package com.ease.platform.messageresource.support;

import java.util.Locale;

import com.ease.common.util.Detect;
import com.ease.platform.messageresource.service.MessageResourceBundleService;

public class MessageResourceBundleManager extends Detect {

	private MessageResourceBundleService messageResourceBundleService;

	private static MessageResourceBundleManager instance = null;

	private MessageResourceBundleManager() {
		MessageResourceBundleManager.instance = this;
	}

	public static MessageResourceBundleManager getInstance() {

		return MessageResourceBundleManager.instance;
	}

	public String getMessage(String code) {
		return messageResourceBundleService.getMessage(code);
	}

	public String getMessage(String code, Object[] args) {
		return messageResourceBundleService.getMessage(code, args);
	}

	public String getMessage(String code, Object[] args, String defaultMessage) {
		return messageResourceBundleService.getMessage(code, args, defaultMessage);
	}

	public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
		return messageResourceBundleService.getMessage(code, args, defaultMessage, locale);
	}

	/**
	 * @return the messageResourceBundleService
	 */
	public MessageResourceBundleService getMessageResourceBundleService() {
		return messageResourceBundleService;
	}

	/**
	 * @param messageResourceBundleService
	 *            the messageResourceBundleService to set
	 */
	public void setMessageResourceBundleService(MessageResourceBundleService messageResourceBundleService) {
		this.messageResourceBundleService = messageResourceBundleService;
	}

}
